package com.jichaoyun.service;

import com.jichaoyun.common.model.PagedResult;
import com.jichaoyun.model.entity.BalanceAlarm;
import com.baomidou.mybatisplus.extension.service.IService;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
* @author zhen
* @description 针对表【balanceAlarm】的数据库操作Service
* @createDate 2023-12-08 11:11:54
*/
public interface IBalanceAlarmService extends IService<BalanceAlarm> {

    /**
     * 报警信息已读
     *
     */
    void MakeAlarmRead(Integer id,Integer userId);

    /**
     * 全部余额报警信息已读接口
     * @param userId
     */
    void MakeAlarmRead(Integer userId);
    /**
     * 查询未读的报警信息
     * @return
     */
    List<Map<String,Object>> pollingDb(Integer userId);

    /**
     * 余额报警用户占比分析
     * @return
     */
    Map<String, Object> selectBalanceAlarmCountALL();

    /**
     * 某年某月余额报警用户占比分析
     * @return
     */
    Map<String, Object> selectBalanceAlarmCountByMonth(LocalDateTime start, LocalDateTime end);

    /**
     * 某年某月余额报警趋势
     * @param start
     * @param end
     * @return
     */
    Map<String, Object> selectBalanceAlarmListByMonth(LocalDateTime start, LocalDateTime end);

    /**
     * 某年某月某条路线余额报警趋势
     * @param start
     * @param end
     * @return
     */
    Map<String, Object> selectBalanceAlarmListByMonthAndLine(Integer lineId, LocalDateTime start, LocalDateTime end);

    /**
     * 余额报警信息查询
     * @param pageNo
     * @return
     */
    PagedResult selectAllBalanceAlarmListByPage(Integer pageNo);

    /**
     * 某条线路余额报警信息查询
     * @param pageNo
     * @return
     */
    PagedResult selectAllBalanceAlarmListByPageAndLine(Integer lineId, Integer pageNo);
}
